package com.cn.common.utils;

/**
 * @Author: jia
 * @Descirption:
 * @Date: 2018/5/15 16:05
 * @Modified By:
 */


public class StringUtils {
    public static  String bytesToHexString(byte[]src){
        StringBuilder builder = new StringBuilder();
        if(src==null||src.length<=0){
            return null;
        }
        for (int i = 0; i < src.length; i++) {
            int v = src[i] & 0xff;
            String hv=Integer.toHexString(v);
            if(hv.length()<2){
                builder.append(0);
            }
            builder.append(hv);

        }
        return builder.toString();
    }
}
